//
//  WaitSendview.m
//  ZYShang
//
//  Created by wangguangming on 15/7/29.
//  Copyright © 2015年 Amber. All rights reserved.
//

#import "WaitSendview.h"
#import "Base.h"
@implementation WaitSendview
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
        {
        self.backgroundColor=COLOR;
        [self addall];
        }
    return self;
}
-(void)addall
{
    self.headView=[[UIView alloc] initWithFrame:CGRectMake(0, 64, WIDTH, 45)];
    
    self.headView.backgroundColor=[UIColor whiteColor];
    
    [self addSubview:self.headView];
    
    self.superButton=[[UIButton alloc] init];
    self.superButton.frame=CGRectMake(0, 0, WIDTH/3, 40);
    self.changeButton=[[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.superButton.frame), CGRectGetMinY(self.superButton.frame), WIDTH/3, 40)];
    self.yudingButton=[[UIButton alloc] initWithFrame:CGRectMake(WIDTH*2/3, 0, WIDTH/3, 40)];
    
    self.superLab=[[UILabel alloc] initWithFrame:CGRectMake(5, 42, WIDTH/3-10, 2)];
    self.changeLab=[[UILabel alloc] initWithFrame:CGRectMake(WIDTH/3+5, 42, WIDTH/3-10, 2)];
    self.yudingLab=[[UILabel alloc] initWithFrame:CGRectMake(WIDTH*2/3+5, 42, WIDTH/3-10, 2)];
    
    
    
    [self.yudingButton setTitle:@"预定订单" forState:UIControlStateNormal];
    [self.superButton setTitle:@"超市订单" forState: UIControlStateNormal];
    [self.changeButton setTitle:@"交换订单" forState:UIControlStateNormal];
    [self.headView addSubview:self.superButton];
    [self.headView addSubview:self.changeButton];
    [self.headView addSubview:self.yudingButton];
    [self.headView addSubview:self.superLab];
    [self.headView addSubview:self.changeLab];
    [self.headView addSubview:self.yudingLab];

    
    self.mainTable=[[UITableView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.headView.frame)+5, WIDTH, HEIGHT-CGRectGetMaxY(self.headView.frame))];
    self.mainTable.backgroundColor=COLOR;
    [self addSubview:self.mainTable];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
